* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: 'Arial', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: #333;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.btn {
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn:active {
  transform: translateY(0);
}

.card {
  background: white;
  border-radius: 15px;
  padding: 20px;
  margin: 10px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.score {
  background: linear-gradient(45deg, #00b894, #00cec9);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: bold;
  text-align: center;
  margin: 10px 0;
}

.timer {
  background: linear-gradient(45deg, #fdcb6e, #e17055);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: bold;
  text-align: center;
  margin: 10px 0;
}

.word-card {
  background: linear-gradient(135deg, #74b9ff, #0984e3);
  color: white;
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.word-card:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

.word-card.flipped {
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
}

.input-field {
  width: 100%;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 18px;
  margin: 10px 0;
  transition: border-color 0.3s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.input-field:focus {
  outline: none;
  border-color: #74b9ff;
}

.correct {
  background: linear-gradient(45deg, #00b894, #00cec9) !important;
  color: white !important;
}

.incorrect {
  background: linear-gradient(45deg, #e17055, #d63031) !important;
  color: white !important;
}

.nav-bar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 15px 0;
  margin-bottom: 30px;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  padding: 10px 20px;
  border-radius: 20px;
  transition: all 0.3s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.nav-links a:hover,
.nav-links a.router-link-active {
  background: linear-gradient(45deg, #74b9ff, #0984e3);
  color: white;
}

/* Chrome移动端特殊修复 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .container {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  
  .card {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

/* 移动端优化 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .game-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  .nav-links a {
    width: 100%;
    text-align: center;
    padding: 12px 15px;
    font-size: 14px;
  }
  
  .card {
    padding: 15px;
    margin: 5px;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 14px;
    width: 100%;
    margin: 5px 0;
  }
  
  .word-card {
    padding: 20px;
    font-size: 18px;
  }
  
  .input-field {
    padding: 12px;
    font-size: 16px;
  }
  
  .score, .timer {
    padding: 8px 15px;
    font-size: 14px;
  }
  
  h1 {
    font-size: 1.8em !important;
  }
  
  h2 {
    font-size: 1.5em !important;
  }
  
  h3 {
    font-size: 1.2em !important;
  }
}

/* 小屏幕手机优化 */
@media (max-width: 480px) {
  .container {
    padding: 5px;
  }
  
  .card {
    padding: 10px;
    margin: 3px;
  }
  
  .btn {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .word-card {
    padding: 15px;
    font-size: 16px;
  }
  
  .input-field {
    padding: 10px;
    font-size: 14px;
  }
  
  .nav-links a {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .game-info {
    flex-direction: column !important;
    gap: 5px !important;
  }
  
  .game-info > div {
    font-size: 12px !important;
    padding: 8px 12px !important;
  }
  
  .matching-area {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
  
  .word-item {
    padding: 12px !important;
    font-size: 14px !important;
    margin: 5px 0 !important;
  }
  
  .memory-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  
  .memory-card .card-text {
    font-size: 12px !important;
    padding: 5px !important;
  }
}

/* 横屏优化 */
@media (max-height: 500px) and (orientation: landscape) {
  .nav-bar {
    padding: 10px 0;
    margin-bottom: 15px;
  }
  
  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .nav-links a {
    width: auto;
    padding: 8px 15px;
    font-size: 12px;
  }
  
  .card {
    padding: 10px;
    margin: 5px;
  }
  
  .game-grid {
    gap: 10px;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .btn:hover {
    transform: none;
  }
  
  .card:hover {
    transform: none;
  }
  
  .word-card:hover {
    transform: none;
  }
  
  .word-item:hover {
    transform: none;
  }
}

/* Chrome移动端强制修复 */
@media screen and (max-width: 768px) {
  * {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  
  body {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
} 